package model;

import connectivity.QueryManager;
import main.BarApplication;

public class Category {

    private int categoryId, maincategoryId;
    private String name;
     private String maincategoryname;

    private String description;


    public Category(int maincategoryId, String maincategoryname) {
        this.maincategoryId = maincategoryId;
        this.maincategoryname = maincategoryname;
    }


    public Category(int category_id, String name, String description) {
        this.categoryId = category_id;
        this.name = name;
        this.description = description;
    }


            public void update() {
        QueryManager queryManager = BarApplication.getQueryManager();
        queryManager.updateCategory(this);
           
    }

    public void insert() {
        QueryManager queryManager = BarApplication.getQueryManager();
        queryManager.addCategory(this);
    }
    
    public Category() {
        this(-1, "", "");
    }

    public Category(int categoryId) {
        this.categoryId = categoryId;
    }


    
    public Category(int category_id, String name, String description, int maincategoryId) {
        this.categoryId = category_id;
        this.name = name;
        this.description = description;
        this.maincategoryId = maincategoryId;
    }

    
    public int getMainCategoryId() {
        return maincategoryId;
    }

    public void setMaincategorie_id(int maincategoryId) {
        this.maincategoryId = maincategoryId;
    }
    
    public String getMaincategoryname() {
        return maincategoryname;
    }

    public void setMaincategoryname(String maincategoryname) {
        this.maincategoryname = maincategoryname;
    }

    /**
     * @return the categoryId
     */
    public int getCategoryId() {
        return categoryId;
    }

    /**
     * @param categoryId the categoryId to set
     */
    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
}
